package com.scs.application.modules.upms.report.handler;

import com.scs.application.core.utils.UserUtils;
import com.google.common.collect.Lists;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Description: upms 下通用的参数处理器
 */
@Component
public class UpmsCommonParamHandler implements ReportParamHandler {

    @Override
    public Object handle(String field, Object value) {

        if ("userId".equals(field)) {
            return UserUtils.currentUser().getId();
        }

        return null;
    }

    @Override
    public List<String> getNeedHandleFields() {
        return Lists.newArrayList("userId");
    }
}
